package com.labofjet.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Aspect
@Component
@Order(AspectOrder.CHECKEXCEPTION_ORDER)
public class ControllerExceptionAspect extends BaseExceptionControllerAspect {
    private static final Logger LOGGER = LoggerFactory.getLogger(ControllerExceptionAspect.class);

    @Around(value = "within(@org.springframework.stereotype.Controller *)")
    public Object check(ProceedingJoinPoint pjp) throws Throwable {
        //LOGGER.debug("开始检查Controller");
        Object result = checkException(pjp);
        //LOGGER.debug("检查Controller检查完毕");
        return result;
    }
}
